from flask import blueprints, render_template, session

from mainapp.dao.bank import BankDao
from mainapp.dao.card_dao import CardDao

blue = blueprints('card',__name__)

@blue.route('/list2')
def listfordb():
    from models import Back
    # 1 dao方式
    # data = {
    #     'banks': BankDao().find_all()
    # }

    # 2 Modle
    data = {
        'banks': Back.query.all()
    }
    return render_template('bank/list02.html',**data)